﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DataProvider.cs" company="hoandd">
//   hoandd
// </copyright>
// <summary>
//   Summary description for SQuestioninfo
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DesktopModules.Surveys
{
    using System.Data;

    public abstract class DataProvider
    {
        /// <summary>
        /// obj Provider
        /// </summary>
        private static DataProvider objProvider = null;

        /// <summary>
        /// Initializes static members of the <see cref="DataProvider"/> class.
        /// </summary>
        static DataProvider()
        {
            CreateProvider();
        }

        /// <summary>
        /// Creates the provider.
        /// </summary>
        private static void CreateProvider()
        {
            objProvider = ((DataProvider)(DotNetNuke.Framework.Reflection.CreateObject("data", "DesktopModules.Surveys", "")));
        }

        /// <summary>
        /// Instances this instance.
        /// </summary>
        /// <returns></returns>
        public static DataProvider Instance()
        {
            return objProvider;
        }

        /// <summary>
        /// Adds the S question.
        /// </summary>
        /// <param name="SQuestionID">The S question ID.</param>
        /// <param name="OrgID">The org ID.</param>
        /// <param name="QuestionType">Type of the question.</param>
        /// <param name="QuestionContent">Content of the question.</param>
        /// <param name="Hidden">if set to <c>true</c> [hidden].</param>
        /// <param name="Public">if set to <c>true</c> [public].</param>
        /// <param name="DateCreated">The date created.</param>
        /// <param name="LastModified">The last modified.</param>
        /// <param name="CreatedByUserID">The created by user ID.</param>
        /// <param name="ModifiedByUserID">The modified by user ID.</param>
        public abstract int AddSQuestion(int OrgID, byte QuestionType, string QuestionContent, bool Hidden, bool Public, System.DateTime DateCreated, System.DateTime LastModified, int CreatedByUserID, int ModifiedByUserID, int ModuleId);

        /// <summary>
        /// Gets the S question.
        /// </summary>
        /// <param name="SQuestionID">The S question ID.</param>
        /// <returns></returns>
        public abstract IDataReader GetSQuestion(int SQuestionID);

        /// <summary>
        /// Gets the S questions.
        /// </summary>
        /// <returns></returns>
        public abstract IDataReader GetSQuestions();

        /// <summary>
        /// Updates the S question.
        /// </summary>
        /// <param name="SQuestionID">The S question ID.</param>
        /// <param name="OrgID">The org ID.</param>
        /// <param name="QuestionType">Type of the question.</param>
        /// <param name="QuestionContent">Content of the question.</param>
        /// <param name="Hidden">if set to <c>true</c> [hidden].</param>
        /// <param name="Public">if set to <c>true</c> [public].</param>
        /// <param name="DateCreated">The date created.</param>
        /// <param name="LastModified">The last modified.</param>
        /// <param name="CreatedByUserID">The created by user ID.</param>
        /// <param name="ModifiedByUserID">The modified by user ID.</param>
        public abstract void UpdateSQuestion(int SQuestionID, int OrgID, byte QuestionType, string QuestionContent, bool Hidden, bool Public, System.DateTime DateCreated, System.DateTime LastModified, int CreatedByUserID, int ModifiedByUserID, int ModuleId);

        /// <summary>
        /// Deletes the S question.
        /// </summary>
        /// <param name="sQuestionID">The S question ID.</param>
        public abstract void DeleteSQuestion(int sQuestionID);

        public abstract void AddSQuestionAnswer(int SQuestionID, string Answer, int ViewOrder);

        public abstract IDataReader GetSQuestionAnswer(int SAnswerID);

        public abstract IDataReader GetSQuestionAnswers();

        public abstract IDataReader GetSQuestionAnswers(int sQuestionID);

        public abstract void UpdateSQuestionAnswer(int SAnswerID, int SQuestionID, string Answer, int ViewOrder);

        public abstract void DeleteSQuestionAnswer(int SAnswerID);

        ///<summary>
        /// The DataProvider class for the  Surveys
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        public abstract int AddSurveys(int OrgID, string Title, bool Public, System.DateTime DateCreated, System.DateTime LastModified, int CreatedByUserID, int ModifiedByUserID, string Description);

        public abstract IDataReader GetSurveys(int SurveyID);

        public abstract IDataReader GetSurveyss();

        public abstract void UpdateSurveys(int SurveyID, int OrgID, string Title, bool Public, System.DateTime DateCreated, System.DateTime LastModified, int CreatedByUserID, int ModifiedByUserID, string Description);

        public abstract void DeleteSurveys(int SurveyID);

        #region Abstract SurveyQuestion methods of table SurveyQuestion

        /****************************************************************************
 * Created By : Do Van Hai Developer
 * Created date : 4/16/2012 3:48 PM
 * Description: Thao tac voi bang SurveyQuestion
 ****************************************************************************/

        /// -----------------------------------------------------------------------------
        ///<summary>
        /// The DataProvider class for the  SurveyQuestion
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        public abstract void AddSurveyQuestion(int SurveyID, int SQuestionID);

        public abstract IDataReader GetSurveyQuestion(int SurveyQuestionID);

        public abstract IDataReader GetSurveyQuestions();

        public abstract void UpdateSurveyQuestion(int SurveyQuestionID, int SurveyID, int SQuestionID);

        public abstract void DeleteSurveyQuestion(int SurveyQuestionID);

        #endregion Abstract SurveyQuestion methods of table SurveyQuestion
    }
}